<html>
<head><meta charset="utf-8"><title>Should Vfs be a trait? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20Vfs.20be.20a.20trait.3F.html">Should Vfs be a trait?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243078770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20Vfs%20be%20a%20trait%3F/near/243078770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Kuhn <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20Vfs.20be.20a.20trait.3F.html#243078770">(Jun 17 2021 at 20:22)</a>:</h4>
<p>I'm currently embedding the ide module into an application, and I had an idea that maybe I could potentially back the Vfs with something like Btrfs COW directories. But it's a concrete data type rather than a trait. Would it be reasonable to refactor it to be a trait to allow experimenting with different backends?</p>



<a name="243089330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20Vfs%20be%20a%20trait%3F/near/243089330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20Vfs.20be.20a.20trait.3F.html#243089330">(Jun 17 2021 at 21:46)</a>:</h4>
<p>VFS is already polymorphic, see the loader module: <a href="https://github.com/matklad/rust-analyzer/blob/66673eae2b3d3185607d29ee341d2db8a81a46e0/crates/vfs/src/loader.rs#L1">https://github.com/matklad/rust-analyzer/blob/66673eae2b3d3185607d29ee341d2db8a81a46e0/crates/vfs/src/loader.rs#L1</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>